//
//  ABStatusBottomView.swift
//  microblog
//
//  Created by 安波 on 15/11/1.
//  Copyright © 2015年 anbo. All rights reserved.
//

import UIKit
import FFAutoLayout

class ABStatusBottomView: UIView {
    
    // MARK: - 构造方法
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        // 设置底部视图的背景图片
        backgroundColor = UIColor.init(patternImage: UIImage(named: "timeline_card_middle_background")!)
        
        // 准备UI
        prepareUI()
    }

    // MARK: - 准备UI
    private func prepareUI(){
        
        // 添加子控件
        addSubview(forwardButton)
        addSubview(commentButton)
        addSubview(lickButton)
        addSubview(separatorViewOne)
        addSubview(separatorViewTwo)
        
        // 添加约束
        self.ff_HorizontalTile([forwardButton,commentButton,lickButton], insets: UIEdgeInsetsZero)
        
        // 分隔线1  horizontal |ˌhɒrɪˈzɒntl, American ˌhɔːr-|  水平的
        separatorViewOne.ff_AlignHorizontal(ff_AlignType.CenterRight, referView: forwardButton, size: nil)
        
        // 分隔线2
        separatorViewTwo.ff_AlignHorizontal(ff_AlignType.CenterRight, referView: commentButton, size: nil)
        
    }
    
    // MARK：懒加载
    /// 转发
    private lazy var forwardButton: UIButton = UIButton(imageName: "timeline_icon_retweet", title: "转发", titleColor: UIColor.lightGrayColor(), fontSize: 12)
    
    /// 评论
    private lazy var commentButton: UIButton = UIButton(imageName: "timeline_icon_comment", title: "评论", titleColor: UIColor.lightGrayColor(), fontSize: 12)
    
    /// 赞
    private lazy var lickButton: UIButton = UIButton(imageName: "timeline_icon_unlike", title: "赞", titleColor: UIColor.lightGrayColor(), fontSize: 12)
    
    /// 分隔线1
    private lazy var separatorViewOne: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line_highlighted"))
    
    /// 分隔线2
    private lazy var separatorViewTwo: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line_highlighted"))

}
